from PyQt5.QtWidgets import QApplication,QWidget,QPushButton
from PyQt5.QtGui import QFont
import sys


class Window(QWidget):

    def __init__(self):
        super().__init__()
        self.initUI()

    def initUI(self):

        # 创建一个按钮
        btn = QPushButton('欢迎',self)
        # 设置按钮位置
        btn.move(100,100)
        # 给按钮绑定操作
        btn.clicked.connect(self.welcome)

        self.setGeometry(1000,300,300,200)
        self.setWindowTitle('提示')
        self.show()

    def welcome(self):
        print('欢迎欢迎，热烈欢迎！')

if __name__ == "__main__":
    app = QApplication(sys.argv)
    w = Window()
    app.exec()